import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
import Layout from '../views/layout/Layout.vue'

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
  {
    path:'/',
    redirect:'/layout/goods'
  },
  {
    path:'/layout',
    name:'layout',
    component:Layout,
    children:[
      {path:'goods',name:'goods',component: ()=> import('../views/goods/Goods.vue')},
      {path:'ratings',name:'ratings',component: ()=> import('../views/ratings/Ratings.vue')},
      {path:'seller',name:'seller',component: ()=> import('../views/seller/Seller.vue')},
    ]
  },
  {
    path:'/detail',
    name:'detail',
    component:() => import('../views/layout/Detail.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
